<template>
  <div id="app">
    性别：{{ sex === 0? '男':'女' }}
    <button @click="resSex">翻转</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sex: 0,
    };
  },
  methods: {
    resSex() {
      this.sex === 0 ? (this.sex = 1) : (this.sex = 0);
    },
  },
};
</script>

<style lang="less">
</style>
